fc737af2af168690cb5d789b0b3539ceb6b08e8c,src/main/java/io/vertx/ext/shell/command/impl/ProcessImpl.java,ProcessImpl,interrupt,#,110
Before Change
public synchronized boolean interrupt() {
if (status == ExecStatus.RUNNING || status == ExecStatus.STOPPED) {
Handler<Void> handler = interruptHandler;
if (handler != null) {
context.runOnContext(handler::handle);
}
return handler != null;
} else {
After Change
public boolean interrupt(Handler<Void> completionHandler) {
if (status == ExecStatus.RUNNING || status == ExecStatus.STOPPED) {
Handler<Void> handler = interruptHandler;
runnerContext.runOnContext(v -> {
try {
if (handler != null) {
handler.handle(null);
}
} finally {
if (completionHandler != null) {
runnerContext.runOnContext(completionHandler);
}
}
});
return handler != null;
} else {
throw new IllegalStateException("Cannot interrupt process in " + status + " state");